package com.woniu.command.purchasecommand;

import com.woniu.command.Command;
import com.woniu.command.handle.PurchaseCommandHandle;
import com.woniu.outlet.po.PurchasePo;
import com.woniu.uitl.ApplicationContextHolder;

public class UpdatePurchaseCommand implements Command<PurchasePo,Integer> {

    private PurchaseCommandHandle handle;

    public UpdatePurchaseCommand() {
        this.handle = ApplicationContextHolder.getApplicationContext().getBean(PurchaseCommandHandle.class);
    }


    public Integer excute(PurchasePo po) {
        Integer integer = handle.updatePur(po);
        return integer;
    }

    public Integer excute(PurchasePo po,String name) {
        Integer integer = handle.updatePurStatus(po,name);
        return integer;
    }
    public Integer excute(Long id,String status) {
        Integer integer = handle.updatePurStatus(id,status);
        return integer;
    }
}
